package com.kiku.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kiku.domain.po.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author kiku
 * @since 2024-06-12
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

     User queryById(Long id);
     @Select("SELECT u.* FROM user u INNER JOIN address a ON u.id = a.user_id ${ew.customSqlSegment}")
     List<User> queryUserByWrapper(@Param("ew") QueryWrapper<User> wrapper);
}

